package com.javaeedev.junit;

import java.util.Calendar;
import java.util.GregorianCalendar;

import javax.ejb.CreateException;
import javax.ejb.SessionBean;

/**
 * Stateless SessionBean
 */
public class GreeterBean implements SessionBean { 

    public String getGreeting() {
        String message = null;
        Calendar calendar = new GregorianCalendar();
        int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
        if(currentHour < 12)
            message = "morning";
        else if(currentHour <18)
            message = "afternoon";
        else
            message = "evening";
        return message;
    }

    public void Greeter() {}

    public void setSessionContext(javax.ejb.SessionContext ctx) {}

    public void ejbCreate() throws CreateException {} 

    public void ejbRemove() {}

    public void ejbActivate() {}

    public void ejbPassivate() {} 
} 
